<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>

<jsp:include page="../header.jsp" />

<style>
th {
	min-width: 100px;
}

td {
	text-align: center;
}
</style>

<table border="1">
	<tr>
		<th style="min-width: 200px;">Od</th>
		<th style="min-width: 200px;">Do</th>
		<th></th>
		<th></th>
	</tr>
	<c:forEach var="notification" items="${listOfNotifications}">
		<tr>
			<td>${notification.getFrom().getName()} ${notification.getFrom().getSurname()}</td>
			<td><c:choose>
					<c:when test="${notification.getTo().getAccountID() eq loggedUser.getAccountID() }">Ja</c:when>
					<c:otherwise>${notification.getTo().getName()} ${notification.getTo().getSurname()}</c:otherwise>
				</c:choose></td>
			<td><a href="notifications.html?confirmId=${notification.getId()}">Potwierdź</a></td>
			<td><a href="notifications.html?deleteId=${notification.getId()}">Usuń</a></td>
		</tr>
	</c:forEach>
</table>


<jsp:include page="../footer.jsp" />